package com.muki.uri.filter;

import com.muki.uri.core.FilterChain;
import com.muki.uri.core.RequestUri;
import com.muki.uri.core.UriFilter;
import com.muki.uri.entity.FlagUri;

public class MukiFilter implements UriFilter{
	
	@Override
	public void filter(RequestUri request,FilterChain chain) {
		FlagUri uri = request.getFlagUri();
		if(uri.getUri().startsWith("http") | uri.getUri().startsWith("https")) {
			chain.doFilter(request);
			System.out.println(uri.getUri()+":通过过滤");
		} else {
			System.out.println(uri.getUri()+":这个uri不是以http或者https开头，被过滤！");
		}
	}

	@Override
	public void init() {
		//System.out.println(this.getClass().getSimpleName()+":初始化启动...");
	}
	
	@Override
	public void destroy() {
		//System.out.println(this.getClass().getSimpleName()+":过滤结束...");
	}

}
